<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>最大最小高宽</title>
    <style>
        /* #item{
            width: 1800px;
            height: 500px;
            margin: 0 auto;
            margin-top: 100px;
        } */
        .box{
            max-width: 900px;
            min-width: 400px;
            max-height: 800px;
            min-height: 400px;
            background-color: red;
        }
        .box img{
            width: 100%;
            height: 100%;
            background-color: rgb(85, 198, 220);
        }
    </style>
</head>
<body>
    <div id="item">
        <div class="box">
            <img src="../image/2.jpg" alt="">
        </div>
    </div>
</body>
</html>